home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 May / macformat-050.iso / Shareware Plus / Developers / Find_icon folder / Sources / Get_resource_icons.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-25  |  1.8 KB  |  67 lines  |  [TEXT/CWIE]

  1. /*    ---------------------------------------------------------------------------------------------
  2.     Find_icon, code for constructing icon suites for files and folders
  3.     
  4.     by James W. Walker
  5.     preferred e-mail: <mailto:jwwalker@kagi.com>
  6.     alternate e-mail: <mailto:jwwalker@aol.com>, <jim@nisus-soft.com>
  7.     web: <http://users.aol.com/jwwalker/>
  8.     
  9.     File: Get_resource_icons.c
  10.     
  11.     Copyright ©1997 by James W. Walker
  12.     
  13.     You may incorporate this sample code into your applications without
  14.     restriction, though the sample code has been provided "AS IS" and the
  15.     responsibility for its operation is 100% yours.
  16.     If you're going to re-distribute the source, please make it clear
  17.     that the code was descended from James W. Walker's code,
  18.     but that you've made changes.
  19.     ---------------------------------------------------------------------------------------------
  20. */
  21.  
  22. #include "Get_resource_icons.h"
  23. #include "Get1IconSuite.h"
  24. #include "Copy_each_icon.h"
  25.  
  26. /*    ---------------------------------------------------------------------
  27.     Get_resource_icons                Get an icon suite from resources in
  28.                                     the current resource file.
  29.     
  30.     Called by Get_normal_file_icon, Get_custom_file_icon,
  31.     Get_normal_folder_icon, Get_volume_icon.
  32.     ---------------------------------------------------------------------
  33. */
  34. pascal OSErr Get1_resource_icons(
  35. /* <-- */    Handle *theSuite,
  36. /* --> */    short theID,
  37. /* --> */    IconSelectorValue theSelector
  38. )
  39. {
  40.     OSErr    err;
  41.     
  42.     err = Get1IconSuite( theSuite, theID, theSelector );
  43.     if (err == noErr)
  44.     {
  45.         err = Copy_each_icon( *theSuite );
  46.     }
  47.     
  48.     return err;
  49. }
  50.  
  51. pascal OSErr Get_resource_icons(
  52. /* <-- */    Handle *theSuite,
  53. /* --> */    short theID,
  54. /* --> */    IconSelectorValue theSelector
  55. )
  56. {
  57.     OSErr    err;
  58.     
  59.     err = GetIconSuite( theSuite, theID, theSelector );
  60.     if (err == noErr)
  61.     {
  62.         err = Copy_each_icon( *theSuite );
  63.     }
  64.     
  65.     return err;
  66. }
  67.